package com.songcha.library_business.viewmodel

import android.app.Application
import com.songcha.library_base.mvvm.base.BaseRefreshViewModel
import com.songcha.library_base.mvvm.base.BaseRepository
import com.songcha.library_base.mvvm.exception.LoginTokenInvalidException
import com.songcha.library_business.proxy.userinfo.UserInfoManager

open class BaseErrorRefreshViewModel<R: BaseRepository,RLST>(app: Application):BaseRefreshViewModel<R,RLST>(app) {
    init {
        apiErrorListener=object :IOnApiErrorListener{
            override fun onApiError(e: Throwable) {
                if(e is LoginTokenInvalidException){
                    UserInfoManager.clearLogin()
                }
            }
        }
    }
}